
package com.hd.appcommon.dd.api.callback;

/**
 * @author hzp
 * @Desc 钉钉事件
 */
public enum EventType {

	CHECK_URL("check_url","测试回调url"),

	BPMS_INSTANCE_CHANGE("bpms_instance_change","审批实例"),
	BPMS_TASK_CHANGE("bpms_task_change","审批任务开始、结束、转交"),

	USER_ADD_ORG("user_add_org","用户添加时间"),

	USER_LEAVE_ORG("user_leave_org","用户离开"),

	ORG_DEPT_CREATE("org_dept_create","部门创建"),

	ORG_DEPT_MODIFY("org_dept_modify","部门修改");


	private String code;

	private String des;

	private EventType(String code, String des) {
		this.code = code;
		this.des = des;
	}
	
	public static EventType getByCode(String code){
		for(EventType keyType : EventType.values()){
			if(keyType.getCode().equals(code)){
				return keyType;
			}
		}
		return null;
	}
	
	public static String getDesByCode(String code){
		for(EventType keyType : EventType.values()){
			if(keyType.getCode().equals(code)){
				return keyType.getDes();
			}
		}
		return null;
	}
	
	public String getCode() {
		return code;
	}

	public String getDes() {
		return des;
	}
}
